package nc.ui.arap.service;

import java.util.Map;

import nc.ui.arap.pub.MyClientEnvironment;
import nc.ui.ep.dj.DjPanel;
import nc.ui.pub.ClientEnvironment;
import nc.vo.arap.engine.BtnInfoVO;
import nc.vo.arap.service.ServiceVO;
import nc.vo.pub.BusinessException;

public class EnvCall  extends AbstractCall{

	public EnvCall(DjPanel djp) {
		super(djp);
	}

	public ServiceVO getServcallVO() {
		callvo=new ServiceVO();
		callvo.setClassname("nc.itf.arap.prv.IArapEnvironmentPrivate");
		callvo.setMethodname("initEnv");
		callvo.setParamtype(new Class[] {String.class});
		callvo.setParam(new Object[] {getPkcorp()});
		return callvo;
	}

	private String getPkcorp() {
		return parent==null?ClientEnvironment.getInstance().getCorporation().getPk_corp():parent.getDjSettingParam().getPk_corp();
	}

	public void handleResult(Map<String, Object> datas)throws BusinessException  {
		MyClientEnvironment.refresh(getPkcorp(),(Map<String, BtnInfoVO>) datas.get(callvo.getCode()));
		MyClientEnvironment.init(getPkcorp());
	}

}
